package com.ruoyi.form.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.form.mapper.FormLogMapper;
import com.ruoyi.form.domain.FormLog;
import com.ruoyi.form.service.IFormLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 接口调用日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-18
 */
@Service
public class FormLogServiceImpl implements IFormLogService 
{
    @Autowired
    private FormLogMapper formLogMapper;

    /**
     * 查询接口调用日志
     * 
     * @param id 接口调用日志主键
     * @return 接口调用日志
     */
    @Override
    public FormLog selectFormLogById(Integer id)
    {
        return formLogMapper.selectFormLogById(id);
    }

    /**
     * 查询接口调用日志列表
     * 
     * @param formLog 接口调用日志
     * @return 接口调用日志
     */
    @Override
    public List<FormLog> selectFormLogList(FormLog formLog)
    {
        return formLogMapper.selectFormLogList(formLog);
    }

    /**
     * 新增接口调用日志
     * 
     * @param formLog 接口调用日志
     * @return 结果
     */
    @Override
    public int insertFormLog(FormLog formLog)
    {
        formLog.setCreateTime(DateUtils.getNowDate());
        return formLogMapper.insertFormLog(formLog);
    }

    /**
     * 修改接口调用日志
     * 
     * @param formLog 接口调用日志
     * @return 结果
     */
    @Override
    public int updateFormLog(FormLog formLog)
    {
        formLog.setUpdateTime(DateUtils.getNowDate());
        return formLogMapper.updateFormLog(formLog);
    }

    /**
     * 批量删除接口调用日志
     * 
     * @param ids 需要删除的接口调用日志主键
     * @return 结果
     */
    @Override
    public int deleteFormLogByIds(String ids)
    {
        return formLogMapper.deleteFormLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除接口调用日志信息
     * 
     * @param id 接口调用日志主键
     * @return 结果
     */
    @Override
    public int deleteFormLogById(Integer id)
    {
        return formLogMapper.deleteFormLogById(id);
    }
}
